{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import numpy as np\n",
    "#data = np.sin(np.arange(20)).reshape(5,4)\n",
    "#print data\n",
    "#ind = data.argmax(axis=0)\n",
    "#print ind\n",
    "#data_max = data[ind, xrange(data.shape[1])]\n",
    "#print data_max\n",
    "all(data_max == data.max(axis=0))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[ 0 10 20 30  0 10 20 30  0 10 20 30  0 10 20 30  0 10 20 30]\n",
      " [ 0 10 20 30  0 10 20 30  0 10 20 30  0 10 20 30  0 10 20 30]\n",
      " [ 0 10 20 30  0 10 20 30  0 10 20 30  0 10 20 30  0 10 20 30]]\n"
     ]
    }
   ],
   "source": [
    "a = np.arange(0, 40, 10)\n",
    "b = np.tile(a, (3, 5)) \n",
    "print b"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": false
   },
   "source": [
    "a = np.arange(0, 40, 10)\n",
    "print a\n",
    "print '---'\n",
    "b = np.tile(a, (1, 4))\n",
    "print b\n",
    "#print a\n",
    "#print b\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2 3 1 0]\n",
      "[1 2 3 4]\n"
     ]
    }
   ],
   "source": [
    "a = np.array([[4, 3, 5], [1, 2, 1]])\n",
    "#print a\n",
    "#b = np.sort(a, axis=1)\n",
    "#print b\n",
    "#b\n",
    "#a.sort(axis=1)\n",
    "#print a\n",
    "a = np.array([4, 3, 1, 2])\n",
    "j = np.argsort(a)\n",
    "print j\n",
    "print a[j]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
